package com.zyb.warehouse.controller;

import com.zyb.warehouse.common.Result;
import com.zyb.warehouse.dto.vo.StoreCountVo;
import com.zyb.warehouse.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Description:数据统计控制类
 */
@RestController
@RequestMapping("/statistics")
public class StatisticsController {

    @Autowired
    private StoreService storeService;

    /**
     * 查询每个仓库存储的商品的数量
     *
     * @return
     */
    @GetMapping("/store-invent")
    public Result getStoreProductTotal() {
        List<StoreCountVo> storeCountVoList = storeService.getStoreProductTotal();
        return Result.ok(storeCountVoList);
    }
}
